<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap{
	protected function _initDB(){
		$dbOption=$this->getOption('resources');
		$dbOption=$dbOption['db'];
		//set up db
		$db=Zend_Db::factory($dbOption['adapter'],$dbOption['params']);
		
		$db->setFetchMode(Zend_Db::FETCH_ASSOC);
		$db->query("SET NAMES 'utf8'");
		$db->query("SET CHARACTER SET 'utf8'");
		
		Zend_Registry::set('connectDB', $db);
		
		// thiet lap de su dung dc modules
		Zend_Db_Table::setDefaultAdapter($db);
		
		return $db;
	}
	protected function _initView(){
		$view=new Zend_View();
		$view->doctype('XHTML1_STRICT');
		$view->headTitle('');
		$view->skin='default';
		
		//add to ViewRender
		$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
		$viewRenderer->setView($view);
		return $view;
	}
}